﻿Imports System.IO
Imports System.Environment


Public Class dolgozo

    Private Sub Bclose_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Bclose.Click
        Close()
    End Sub

    Private Sub Bhozzaad_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Bhozzaad.Click
        If TBnev.Text = "" Or TBadoszam.Text = "" Then
            MsgBox("Ne hagyjon semmit üresen!", MsgBoxStyle.Exclamation, "Hiba")
        Else
            RTBseged.Text += TBnev.Text + NewLine + TBadoszam.Text + NewLine

            Dim f As New StreamWriter("dolgozo.txt")
            f.Write(RTBseged.Text)
            f.Close()
            Close()
        End If

    End Sub

    Private Sub dolgozo_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim f As New StreamReader("dolgozo.txt")
        RTBseged.Text = f.ReadToEnd
        f.Close()
    End Sub
End Class